package com.car.dal.dao.period;

import java.util.List;

import com.car.bean.GridObj;
import com.car.bean.OrderObj;
import com.car.bean.PageObj;
import com.car.dal.dao.ibatis.IbatisCommonDao;
import com.car.dal.object.TgPeriod;
import com.car.util.Page;

public class TgPeriodDaoImpl extends IbatisCommonDao<TgPeriod, Long> implements TgPeriodDao {

	public GridObj GetList(TgPeriod period, PageObj pageObj) {
		OrderObj order = new OrderObj();
		order.setDir("asc");
		order.setSort("id");
		// TODO Auto-generated method stub
		return super.findByPage(period, pageObj, order);
	}
	
	public Integer getPreCountByType(TgPeriod period) {
		return this.queryForInteger("getPreCountByType", period);
	}
	
	public List<TgPeriod> getPeriodByType(TgPeriod period,Page page) {
		period.setFirstrownum(page.getFirstrownum());
		period.setPagesize(page.getPagesize());
		return this.queryForEntityList(TgPeriod.class,"getPeriodByType", period);
	}

	@Override
	public List<TgPeriod> getPeriodByTime(TgPeriod period) {
		
		return this.queryForEntityList(TgPeriod.class,"getPeriodByTime", period);
	}
	@Override
	public List<TgPeriod> getPeriodByTime1(TgPeriod period) {
		
		return this.queryForEntityList(TgPeriod.class,"getPeriodByTime1", period);
	}
	
	@Override
	public List<TgPeriod> getPeriodByTiAll(TgPeriod period) {
		
		return this.queryForEntityList(TgPeriod.class,"getPeriodByTiAll", period);
	}

	@Override
	public List<TgPeriod> getSYUser(TgPeriod period) {
		return this.queryForEntityList(TgPeriod.class,"getSYUser", period);
	}

	@Override
	public List<TgPeriod> getZrUser(TgPeriod period) {
		return this.queryForEntityList(TgPeriod.class,"getZrUser", period);
	}

	@Override
	public List<TgPeriod> getZnUser(TgPeriod period) {
		return this.queryForEntityList(TgPeriod.class,"getZnUser", period);
	}

	@Override
	public List<TgPeriod> getByUserId(TgPeriod period) {
		System.out.println(period.getId());
		return this.queryForEntityList(TgPeriod.class,"getByUserId", period);
	}

	@Override
	public List<TgPeriod> getPeriodByTime2(TgPeriod period) {
		return this.queryForEntityList(TgPeriod.class,"getPeriodByTime2", period);
	}

	
}
